# 基础镜像
FROM openjdk:8u131-jdk-alpine

# 设定时区
ENV TZ=Asia/Shanghai
# 运行shell命令
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 拷贝jar包
COPY k8s-demo01.jar /app.jar
# 入口
ENTRYPOINT ["java", "-jar", "/app.jar"]

# 构建镜像[传递参数]
# docker build -t k8s-demo01:v1.0 .

# 运行容器-测试镜像
# docker run -d -p 1001:1001 --name k8s-demo01-c k8s-demo01:v1.0


# 推送镜像至阿里云
# docker login --username=13527403978tt crpi-15n596973ajdrml4.cn-chengdu.personal.cr.aliyuncs.com
# docker tag [ImageId] crpi-15n596973ajdrml4.cn-chengdu.personal.cr.aliyuncs.com/tristan001/k8s-demo01:[镜像版本号]
# docker push crpi-15n596973ajdrml4.cn-chengdu.personal.cr.aliyuncs.com/tristan001/k8s-demo01:[镜像版本号]